<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>病史</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/default/easyui.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/page/questionnaire/questionnaireAnswer.js"></script>
<style type="text/css">
	.lab{
		width: 145px;
		display: inline-block;
	}
</style>
</head>
<body>
<div style="padding-left: 10%;">
<form id="frman48" method="post" enctype="multipart/form-data">
<input type="hidden" id="questionnaireId" value="${questionnaireId }">
<input type="hidden" id="questionnaireAnswerId" value="${answer_id }">
<div style="border: 1px solid #CCDDFF;padding: 10px;width: 80%;">
	提交人：<span id="spAnswerUser">&nbsp;</span><br/>
	提交时间：<span id="spAnswerDate">&nbsp;</span>
</div>
<h3>病史相关信息：</h3><br/>
1、这次流产的主要原因是：
<div name="question_54" title="54" type="1" style="display: inline;">
<div id="question_54_99"  style="display: none;">未避孕</div>
<div id="question_54_100" style="display: none;">避孕失败</div>
<div id="question_54_101" style="display: none;">意愿妊娠（但是其他原因导致如医学原因或者其他社会原因）</div>
</div>
<br/>
<div id="div_question_54_99" name="div_question_54_99" class="div_question_54_99" style="display: none;">
2、未避孕的原因是：
<div name="question_56" title="56" type="1" style="display: inline;">
<div id="question_56_106" style="display: none;">觉得不会怀孕</div>
<div id="question_56_107" style="display: none;">不知道怎么避孕</div>
<div id="question_56_108" style="display: none;">当时没有避孕药具</div>
<div id="question_56_109" style="display: none;">未找到适合的方法</div>
<div id="question_56_171" style="display: none;">男伴不愿意使用</div>
<div id="question_56_172" style="display: none;">双方都不愿意使用</div>
<div id="question_56_173" style="display: none;">经济原因</div>
<div id="question_56_174" style="display: none;">其他,</div>
</div>
</div>
<br/>
<div id="div_question_54_100" name="div_question_54_100" class="div_question_54_100" style="display: none;">
2、是什么避孕方法导致的失败：
<div name="question_55" title="55" type="1" style="display: inline;">
<div id="question_55_102" style="display: none;">绝育</div>
<div id="question_55_103" style="display: none;">宫内节育器</div>
<div id="question_55_104" style="display: none;">短效口服避孕药</div>
<div id="question_55_105" style="display: none;">避孕栓、膏/膜</div>
<div id="question_55_175" style="display: none;">避孕套</div>
<div id="question_55_176" style="display: none;">皮埋</div>
<div id="question_55_177" style="display: none;">避孕针</div>
<div id="question_55_178" style="display: none;">紧急避孕药</div>
<div id="question_55_179" style="display: none;">安全期</div>
<div id="question_55_180" style="display: none;">体外排精</div>
</div>
</div>


<h3>现病史：</h3>
<div style="width: 680px;">
平时月经
<div name="question_57" title="57" type="1" style="display: inline;">
	<div id="question_57_110" style="display: none;">规则</div>
	<div id="question_57_111" style="display: none;">不规则</div>
</div>，
(月经持续天数)
<div id="question_58" name="question_58" title="58" type="3" style="display:inline"></div>
/<div id="question_59" name="question_59" title="59" type="3" style="display:inline"></div>
(月经间隔天数)天，末次月经时间：
<div id="question_60" name="question_60" title="60" type="3" style="display:inline"></div>，
平时月经量
<div name="question_61" title="61" type="1" style="display: inline;">
	<div id="question_61_112" style="display: none;">少</div>
	<div id="question_61_113" style="display: none;">中</div>
	<div id="question_61_114" style="display: none;">多</div>
</div>，
<div name="question_62" title="62" type="1" style="display: inline;">
	<div id="question_62_115" style="display: none;">有</div>
	<div id="question_62_116" style="display: none;">无</div>
</div>痛经，
白带量
<div name="question_63" title="63" type="1" style="display: inline;">
	<div id="question_63_117" style="display: none;">多</div>
	<div id="question_63_273" style="display: none;">中</div>
	<div id="question_63_118" style="display: none;">少</div>
</div>，
<div id="question_64" name="question_64" title="64" type="1" style="display:inline">
	<div id="question_64_264" style="display: none;">白色</div>
	<div id="question_64_265" style="display: none;">黄色</div>
	<div id="question_64_266" style="display: none;">黄绿</div>
	<div id="question_64_267" style="display: none;">红色</div>
	<div id="question_64_268" style="display: none;">褐色</div>
	<div id="question_64_269" style="display: none;">清亮</div>
</div>，
<div name="question_65" title="65" type="1" style="display: inline;">
	<div id="question_65_119" style="display: none;">有</div>
	<div id="question_65_120" style="display: none;">无</div>
</div>异味。
<div id="question_66" name="question_66" title="66" type="3" style="display:inline"></div>
天前，通过
<div id="question_67" name="question_67" title="67" type="1" style="display:inline">
	<div id="question_67_270" style="display: none;">验孕棒</div>
	<div id="question_67_271" style="display: none;">血HCG</div>
	<div id="question_67_272" style="display: none;">B超</div>
</div>发现怀孕，
<div name="question_68" title="68" type="1" style="display: inline;">
	<div id="question_68_121" style="display: none;">有</div>
	<div id="question_68_122" style="display: none;">无</div>
</div>明显腹痛，
<div name="question_81" title="81" type="1" style="display: inline;">
	<div id="question_81_159"  style="display:none;">有</div>
	<div id="question_81_160"  style="display:none;">无</div>
</div>阴道流血。
<div name="question_69" title="69" type="1" style="display: inline;">
	<div id="question_69_123"  style="display:none;">去过其他医院检查，</div>
	<div id="question_69_124"  style="display:none;">没去过其他医院检查。</div>
</div>
<div class="div_question_69_123" style="display: none;">
检查医院：<div id="question_82" name="question_82" title="82" type="3" style="display:inline"></div>，
</div>
<div class="div_question_69_123" style="display: none;">
检查内容：<div id="question_83" name="question_83" title="83" type="3" style="display:inline"></div>，
</div>
<div class="div_question_69_123" style="display: none;">
检查结果：<div id="question_84" name="question_84" title="84" type="3" style="display:inline"></div>；
</div>
<div class="div_question_69_123" style="display: none;">
具体情况,血常规：<div id="question_85" name="question_85" title="85" type="3" style="display:inline"></div>，
</div>
<div class="div_question_69_123" style="display: none;">
白带：<div id="question_86" name="question_86" title="86" type="3" style="display:inline"></div>，
</div>
<div class="div_question_69_123" style="display: none;">
B 超：<div id="question_87" name="question_87" title="87" type="3" style="display:inline"></div>，
</div>
<div class="div_question_69_123" style="display: none;">
尿 HCG：<div id="question_88" name="question_88" title="88" type="3" style="display:inline"></div>，
</div>
<div class="div_question_69_123" style="display: none;">
血 HCG：<div id="question_89" name="question_89" title="89" type="3" style="display:inline"></div>，
</div>
<div class="div_question_69_123" style="display: none;">
肝功：<div id="question_90" name="question_90" title="90" type="3" style="display:inline"></div>，
</div>
<div class="div_question_69_123" style="display: none;">
凝血：<div id="question_91" name="question_91" title="91" type="3" style="display:inline"></div>。
</div>
</div>
<br/>


<h3>即往史：</h3>
<div style="width: 680px;">
既往曾怀孕过(含本次)
<div id="question_113" name="question_113" title="113" type="3" style="display:inline"></div>
次，生育
<div id="question_114" name="question_114" title="114" type="3" style="display:inline"></div>
次，其中顺产
<div id="question_115" name="question_115" title="115" type="3" style="display:inline"></div>
次，剖宫产
<div id="question_116" name="question_116" title="116" type="3" style="display:inline"></div>
次。<br/>
身体
<div name="question_117" title="117" type="1" style="display: inline;">
	<div id="question_117_254"  style="display:none;">健康</div>
	<div id="question_117_255"  style="display:none;">欠佳</div>
</div>。
<div name="question_118" title="118" type="1" style="display: inline;">
	<div id="question_118_256"  style="display:none;">有</div>
	<div id="question_118_257"  style="display:none;">无</div>
</div>
结核、肝炎以及其他传染病史；
<div name="question_119" title="119" type="1" style="display: inline;">
	<div id="question_119_258"  style="display:none;">有</div>
	<div id="question_119_259"  style="display:none;">无</div>
</div>
手术、外伤史；
<div name="question_120" title="120" type="1" style="display: inline;">
	<div id="question_120_260"  style="display:none;">有</div>
	<div id="question_120_261"  style="display:none;">无</div>
</div>
输血史；
<div name="question_121" title="121" type="1" style="display: inline;">
	<div id="question_121_262"  style="display:none;">有</div>
	<div id="question_121_263"  style="display:none;">无</div>
</div>
过敏史；
<!-- 
预防接种史：
<div id="question_122" name="question_122" title="122" type="3" style="display:inline"></div>
 -->
</div>
</form>


<div id="div_answerFiles" style="margin-top: 10px;">

</div>

<div id="div_diagnosis_content" style="display: none;margin-top: 10px;border: 1px solid #CCDDFF;padding: 10px;width: 80%;">
	诊断结果：<span id="td_diagnosis">&nbsp;</span><br/>
	诊断医生：<span id="td_doctorName">&nbsp;</span><br/>
	诊断时间：<span id="td_diagnosis_date">&nbsp;</span>
</div>
	
	<c:if test="${goback==true}">
	<div id="div_diagnosis" style="display: none;margin-top: 10px;padding: 10px;width: 80%;border: 1px solid #CCDDFF;">
		<strong>诊断结果：</strong>
		<form id="frmQuestionnaireDiagnosis">
		<div style="width: 400px;">
			 &nbsp;
			 <input type="hidden" id="id" name="id" value="${answer_id }">
			 G<input id="txtZdg" name="zdg" class="easyui-numberspinner" data-options="min:0,max:9,required:true" style="width: 50px;">
			 P<input id="txtZdp" name="zdp" class="easyui-numberspinner" data-options="min:0,max:9,required:true" style="width: 50px;">
			 <input id="txtZdz" name="zdz" class="easyui-numberspinner" data-options="min:5,max:20,required:true" style="width: 50px;">+
			 <input id="txtZdt" name="zdt" class="easyui-numberspinner" data-options="min:0,max:6,required:true" style="width: 50px;">周
			 <br/>
			 <input id="txtZdHandle_rglc" type="radio" name="zdHandle" value="人工流产"><label for="txtZdHandle_rglc">人工流产</label>
			 <input id="txtZdHandle_ywlc" type="radio" name="zdHandle" value="药物流产/清宫"><label for="txtZdHandle_ywlc">药物流产/清宫</label>
			 <input id="txtZdHandle_ywrs" type="radio" name="zdHandle" value="异位妊娠"><label for="txtZdHandle_ywrs">异位妊娠</label>
			 <input id="txtZdHandle_zy" type="radio" name="zdHandle" value="早孕"><label for="txtZdHandle_zy">早孕</label>
			 <br/>
			 <input id="txtZdHandle_other" type="radio" name="zdHandle" value="" >
			 <label for="txtZdHandle_other">
			 <input id="txtZdHandle_other_content" type="text" class="easyui-textbox" name="zdHandle_other" style="width: 280px;" data-options="prompt:'其他'">
			 </label>
		</div>
		</form>
	</div>
	</c:if>
</div>
<br/>
<c:if test="${goback==true}">
	<div style="text-align: center;">
		<a href="/pac/questionnaire/gotoPage?pageName=questionnaireAnswerList&questionnaireType=0">返回</a>
		<div id="div_btn_diagnosis" style="display: none;margin-left: 30px;">
			<a href="javascript:void(0)" onclick="submitDiagnosis()">提交诊断</a>
		</div>
		<div id="div_btn_edit_answer" style="display:none;margin-left: 30px;">
			<a href="javascript:void(0)" onclick="editAnswer()">修改病史</a>
		</div>
		<div id="div_btn_edit_answer_do" style="margin-left: 30px;display: none;">
			<a href="javascript:void(0)" onclick="editAnswerDo()">提交修改</a>
		</div>
	</div>
</c:if>
<script type="text/javascript">
	

	function showOtherCheck()
	{
		$("#otherCheck").css("display","block");	
	}
	
	function hidenOtherCheck()
	{
		$("#otherCheck").css("display","none");
	}
	
	//显示关联问题
	function showDivQuestion(qiestionId,val)
	{
		$("div[name^='div_"+qiestionId+"']").each(function(i){  
			  $(this).css("display","none");
		}); 
		$("div[name^='div_"+qiestionId+"_"+val+"']").each(function(i){  
			  $(this).css("display","block");
		}); 
	}
	
	//编辑病史
	function editAnswer()
	{
		//月经持续天数
		var question_58_val=$("#question_58").html();
		var question_58_answerid=$("#question_58").attr("answerid");
		var question_58_str="<input id='txtQuestion_58' name='answer_3_"+question_58_answerid+"' class='easyui-numberspinner' data-options='min:0,max:20,required:true' style='width: 50px;' value='"+question_58_val+"'>";
		$("#question_58").html(question_58_str);
		
		//月经间隔天数
		var question_59_val=$("#question_59").html();
		var question_59_answerid=$("#question_59").attr("answerid");
		var question_59_str="<input id='txtQuestion_59' name='answer_3_"+question_59_answerid+"' class='easyui-numberspinner' data-options='min:0,max:100,required:true' style='width: 50px;' value='"+question_59_val+"'>";
		$("#question_59").html(question_59_str);
		
		//末次月经时间
		var question_60_val=$("#question_60").html();
		var question_60_answerid=$("#question_60").attr("answerid");
		var question_60_str="<input id='txtQuestion_60' name='answer_3_"+question_60_answerid+"' class='easyui-datebox' data-options='required:true' style='width: 100px;' value='"+question_60_val+"'>";
		$("#question_60").html(question_60_str);
		
		//几天前发现怀孕
		var question_66_val=$("#question_66").html();
		var question_66_answerid=$("#question_66").attr("answerid");
		var question_66_str="<input id='txtQuestion_66' name='answer_3_"+question_66_answerid+"' class='easyui-numberspinner' data-options='min:0,max:20,required:true' style='width: 50px;' value='"+question_66_val+"'>";
		$("#question_66").html(question_66_str);
		
		//怀孕次数
		var question_113_val=$("#question_113").html();
		var question_113_answerid=$("#question_113").attr("answerid");
		var question_113_str="<input id='txtQuestion_113' name='answer_3_"+question_113_answerid+"' class='easyui-numberspinner' data-options='min:0,max:20,required:true' style='width: 50px;' value='"+question_113_val+"'>";
		$("#question_113").html(question_113_str);
		
		//生育次数
		var question_114_val=$("#question_114").html();
		var question_114_answerid=$("#question_114").attr("answerid");
		var question_114_str="<input id='txtQuestion_114' name='answer_3_"+question_114_answerid+"' class='easyui-numberspinner' data-options='min:0,max:20,required:true' style='width: 50px;' value='"+question_114_val+"'>";
		$("#question_114").html(question_114_str);
		
		//顺产次数
		var question_115_val=$("#question_115").html();
		var question_115_answerid=$("#question_115").attr("answerid");
		var question_115_str="<input id='txtQuestion_115' name='answer_3_"+question_115_answerid+"' class='easyui-numberspinner' data-options='min:0,max:20,required:true' style='width: 50px;' value='"+question_115_val+"'>";
		$("#question_115").html(question_115_str);
		
		//剖宫产次数
		var question_116_val=$("#question_116").html();
		var question_116_answerid=$("#question_116").attr("answerid");
		var question_116_str="<input id='txtQuestion_116' name='answer_3_"+question_116_answerid+"' class='easyui-numberspinner' data-options='min:0,max:20,required:true' style='width: 50px;' value='"+question_116_val+"'>";
		$("#question_116").html(question_116_str);
		
		//隐藏诊断框
		$("#div_diagnosis").hide();
		$("#div_btn_diagnosis").hide();
		$("#div_btn_edit_answer").hide();
		$("#div_btn_edit_answer_do").css("display","inline-block");
		
		$.parser.parse();
	}
	
	//修改病史提交
	function editAnswerDo()
	{
		$('#frman48').form('submit', {    
		    url:"${pageContext.request.contextPath}/questionnaire/answer/edit",    
		    onSubmit: function(){     
		    	return $(this).form('validate');
		    },    
		    success:function(dataStr){  
		    	var data=JSON.parse(dataStr);
		    	if(data.result==true)
	        	{
		    		queryAnswer();
		    		$.messager.alert("提示",data.msg);
		    		$("#div_diagnosis").show();
		    		$("#div_btn_diagnosis").css("display","inline-block");
		    		$("#div_btn_edit_answer").css("display","inline-block");
		    		$("#div_btn_edit_answer_do").hide();
	        	}    
		    	else
		    	{
		    		$.messager.alert("提示",data.msg,"error");
		    	}
		    }    
		});
	}
	
</script>
</body>
</html>